package xyz.jangle.array;

import java.util.Arrays;

public class CopyArray {

	public static void main(String[] args) {
		
		int[] a = {1,2,3,4,5};
		int[] copyOf = Arrays.copyOf(a, a.length);
		System.out.println(Arrays.toString(copyOf));
		copyOf[0] = 9;
		System.out.println(Arrays.toString(copyOf));
		System.out.println(Arrays.toString(a));		//copyOf方法复制的数组是不同的引用。
		
	}

}
